import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login.vue"),
  },
  {
    path: "/",
    redirect: "index",
    component: () => import("@/layout/index.vue"),
    children: [
      {
        path: "index",
        name: "Index",
        component: () => import("@/views/index.vue"),
        meta: { title: "首页", icon: "home" },
      },
      {
        path: "ChannelManage",
        name: "ChannelManage",
        component: () => import("@/views/ChannelCenter/ChannelManage.vue"),
        meta: { title: "渠道中心", icon: "ChannelManage" },
      },
      {
        path: "ProductManage",
        name: "ProductManage",
        component: () => import("@/views/ProductManage/ProductManage.vue"),
        meta: { title: "商品中心" },
      },
      {
        path: "ProductDetail",
        name: "ProductDetail",
        component: () => import("@/views/ProductManage/ProductDetail.vue"),
        meta: { title: "商品详情" },
      },
      {
        path: "OrderManage",
        name: "OrderManage",
        component: () => import("@/views/OrderManage/OrderManage.vue"),
        meta: { title: "订单中心" },
      },
      {
        path: "OrderDetail",
        name: "OrderDetail",
        component: () => import("@/views/OrderManage/OrderDetail.vue"),
        meta: { title: "订单详情" },
      },
      {
        path: "ContractManage",
        name: "ContractManage",
        component: () => import("@/views/Contract/ContractManage.vue"),
        meta: { title: "合同管理", icon: "ContractManage" },
      },
      {
        path: "ContractTemplate",
        name: "ContractTemplate",
        component: () => import("@/views/Contract/ContractTemplate.vue"),
        meta: { title: "合同模版管理", icon: "ContractTemplate" },
      },
      {
        path: "CreateContract",
        name: "CreateContract",
        component: () => import("@/views/Contract/CreateContract.vue"),
        meta: { title: "创建合同", icon: "CreateContract" },
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
